package com.example.sonone.dao;

import com.example.sonone.pojo.GoodsStockLabelTree;
import com.example.sonone.pojo.Stu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface TestDao {


    List<Map<String, String>> excelList();


    List<Integer> getRow();


    void inset(@Param("map") Map<String, String> map);


    //往t1表中插入1万跳数据
    int insetT1(@Param("list") List<Map<String, Integer>> list);

    //测试nginx负载
    int insertStu(@Param("list") List<Stu> list);


    @Select("select * from test.shijian")
    List<Map<String, String>> testDate();


    @Select("select * from stu limit #{params.offset},#{params.size}")
    List<Map<String, Object>> selectTest(@Param("params") Map<String, Object> params);

    List<Map<String, Object>> getTruckCountByMonth(String month);


    List<Map<String, Object>> getUnitCountByMonth(String month);

    @Insert("insert into stu(name) values ('xxx')")
    void insetShiwu();

    @Select(" select * from stu where id=#{id} ")
    Map<String, Object> sel(int id);


    @Delete(" delete from stu where id=#{id} ")
    Integer del1(int id);


    @Delete(" delete from stu where id=#{id} ")
    int del2(int id);

    @Select(" select count  from stu where id=#{id} ")
    Integer sel1(int id);


    @Select(" select count  from stu where id=#{id} ")
    int sel2(int id);

    @Select("      select id,title,type,value,pid,status,tsp_id as tspId,tsp_pid as tspPid,source_system as sourceSystem,is_show as isShow " +
            "        from dms_goods_stock_label\n" +
            "        where is_del = 0 AND status='2'")
    List<GoodsStockLabelTree> selectAllLabel();
}
